package 剑指offer_力扣版.Month07.day02整数;

public class 排序数组中两个数字之和 {
    public int[] twoSum(int[] numbers, int target) {
        int left = 0;
        int right = numbers.length - 1;
        while(left < right){
            int res = numbers[left] + numbers[right];
            if(res > target){
                right--;
            }else if(res < target){
                left++;
            }else {
                return new int[]{left,right};
            }
        }
        return null;
    }
}
